package com.puntodonna.fogliocassa.client.app.place.login;

import com.gwtplatform.mvp.client.ViewImpl;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PasswordTextBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;

public class LoginView extends ViewImpl implements LoginPresenter.MyView {

	private final Widget widget;

	public interface Binder extends UiBinder<Widget, LoginView> {
	}

	@UiField
	protected TextBox userTextBox;
	@UiField
	protected PasswordTextBox passwordTextBox;
	@UiField
	protected Button loginBtn;
	@UiField
	protected Button createBtn;
	@UiField
	protected Label messageLbl;

	@Inject
	public LoginView(final Binder binder) {
		widget = binder.createAndBindUi(this);
	}

	@Override
	public Widget asWidget() {
		return widget;
	}

	public TextBox getUserTextBox() {
		return userTextBox;
	}

	public PasswordTextBox getPasswordTextBox() {
		return passwordTextBox;
	}

	public Button getLoginBtn() {
		return loginBtn;
	}
	
	public Button getCreateBtn() {
		return createBtn;
	}

	protected Label getMessageLbl() {
		return messageLbl;
	}

	public void setMessage(String message) {
		getMessageLbl().setText(message);
	}
}
